import http from "@/utils/request";

export async function createOrder(data: any): Promise<API.Result> {
    return http.post("orders", data);
}

export async function getOrders(state?: number, current: number = 1, pageSize: number = 10): Promise<API.Result> {
    return http.get("orders", {params: {state, current, pageSize}});
}

export async function getOrderDetail(orderId?: number | string): Promise<API.Result> {
    return http.get("orders/" + orderId,);
}

export async function getTaskId(orderId?: number | string): Promise<API.Result> {
    return http.get("orders/get_task_id/" + orderId,);
}